package com.zyh.day01

object FunctionTest {
  def main(args: Array[String]): Unit = {
    var a = 10
    var b = 20
    val r1: Int = sum(a, b)
    val r2: Int = max(a, b)
    val r3: Int = min(a, b)
    println(s"r1,r2,r3 = ${r1},${r2},${r3}")
    test()
    test2()
    lazy val str = test2()
    println(s"str = ${str}")
  }

  def sum(i:Int,j:Int) = {
    i+j
  }
  def max(i: Int,j: Int): Int = {
    return if(i>j) i else j
  }
  def min(i: Int,j: Int): Int = if(i<j) i else j

  def test() = println("无返回值")

  def test2():Int = 100
}
